// controller.h
#pragma once
#include <vector>
#include <string>
#include "logical_clock.h"
#include "ntp_logic_demo.h" // 确保这里的 make_req 参数类型是 tsync::LogicalClock&

namespace tsync {
    inline std::string metrics_path;
struct Neighbor {
  std::string ip;
  uint16_t    port;
};
    struct NeighborGroup {
        std::string name;
        std::vector<Neighbor> peers;
    };
void run_controller(std::vector<Neighbor>& neighbors,
                    uint32_t tau_ns,
                    const char* bind_ip,
                    int recv_window_ms,
                    uint16_t listen_port,
                    double k_limit,
                    LogicalClock& lc,const std::string& metricsPath);   // ★ 新：从外部传入时钟

// void run_controller(std::vector<Neighbor>& neighbors,
//                     uint32_t tau_ns,
//                     const char* bind_ip,
//                     int recv_window_ms,
//                     double k_limit,
//                     LogicalClock& lc);   // ★ 新：无 responder 的重载

} // namespace tsync
